package com.whfc.fmam.dao;

import com.whfc.fmam.entity.bo.FmamWeighNoteImg;
import com.whfc.fmam.entity.dto.FmamWeighNoteImgDTO;
import com.whfc.fmam.entity.dto.SyncFmamWeighNoteImgDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

@Repository
public interface FmamWeighNoteImgMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FmamWeighNoteImg record);

    int insertSelective(FmamWeighNoteImg record);

    FmamWeighNoteImg selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FmamWeighNoteImg record);

    int updateByPrimaryKey(FmamWeighNoteImg record);

    /**
     * 批量插入
     *
     * @param weighNoteImgList
     * @return
     */
    int batchInsert(@Param("weighNoteImgList") Collection<FmamWeighNoteImg> weighNoteImgList);

    /**
     * 查询磅单图片
     *
     * @param weighNoteGuid
     * @return
     */
    List<SyncFmamWeighNoteImgDTO> selectSyncWeighNoteImgDTOList(@Param("weighNoteGuid") String weighNoteGuid);

    /**
     * 根据磅单guid查找
     *
     * @param weighNoteGuid
     * @return
     */
    List<FmamWeighNoteImgDTO> selectByWeighNoteGuid(@Param("weighNoteGuid") String weighNoteGuid);

    /**
     * 更新磅单图片的磅单ID
     *
     * @param weighNoteGuid weighNoteGuid
     * @param imgIdList     imgIdList
     */
    void updateWeighNoteGuid(@Param("weighNoteGuid") String weighNoteGuid, @Param("imgIdList") List<Long> imgIdList);

    /**
     * 删除绑定图片
     *
     * @param weighNoteGuid
     * @param type
     * @param imgType
     */
    void deleteByWeighNoteGuidAndImgType(@Param("weighNoteGuid") String weighNoteGuid,
                                         @Param("type") Integer type,
                                         @Param("imgType") Integer imgType);


    /**
     * 查询磅单图片
     *
     * @param weighNoteGuid
     * @return
     */
    List<FmamWeighNoteImg> selectWeighNoteImgList(@Param("weighNoteGuid") String weighNoteGuid);
}